﻿<%@ Page Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="RoleAdmin.aspx.cs" Inherits="RDIFramework.WebApp.Modules.RoleAdmin" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<script src="../Scripts/jquery-checkbox.js" type="text/javascript"></script>
<script src="../Scripts/jQuery.Select.js" type="text/javascript"></script>
<script src="../Scripts/jquery.easyListSplitter.js" type="text/javascript"></script>
<script src="../Scripts/Business/RoleAdmin.js" type="text/javascript"></script>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<div class="toolbar">
    <%=base.BuildToolBarButtons() %> &nbsp;&nbsp;角色分类：&nbsp; <input id="txtCategory" name=Category type="text" style="width:200px" class="txt03" />&nbsp;&nbsp;<a id="a_search" class="easyui-linkbutton" plain="true" icon="icon-search">查询</a>
</div>
<div id="scolldiv" style="width:100%;overflow:auto;">
    <input id="hidrolecategory" type="hidden" value="" runat="server" />
 <asp:GridView ID="gvRoleList" runat="server" AutoGenerateColumns="False" CssClass="grid2" Width="100%">
        <Columns>        
        <asp:TemplateField ItemStyle-Width="1px"  ItemStyle-HorizontalAlign="Center"> 
            <ItemTemplate>
                <input type="hidden" value="<%#Eval("Id") %>" />               
            </ItemTemplate>
        </asp:TemplateField>
        <%--<asp:TemplateField ItemStyle-Width="20px"  ItemStyle-HorizontalAlign="Center" >            
            <ItemTemplate>                
                <%#Container.DataItemIndex+1 %>                
            </ItemTemplate>        
        </asp:TemplateField>  --%>
            <asp:BoundField DataField="Code" HeaderText="角色编号" ItemStyle-Width = "120px"/>           
            <asp:BoundField DataField="RealName" HeaderText="角色名称"  ItemStyle-Width = "150px"/>            
            <asp:BoundField DataField="Enabled" HeaderText="有效" ItemStyle-Width = "80px"/>
            <%--<asp:TemplateField HeaderText="状态" ItemStyle-HorizontalAlign="Center">
                <ItemTemplate>             
                    <img alt="角色状态" src='<%# GetEnabledImage(Eval("Enabled").ToString())%>' />
                </ItemTemplate>
            </asp:TemplateField> --%>    
            <asp:BoundField DataField="Description" HeaderText="描述"/>
            <asp:TemplateField HeaderText="管理" ItemStyle-Width="320px" ItemStyle-HorizontalAlign="Center">
                <ItemTemplate>
                    <a href="#" rel="edit" rid="<%#Eval("Id")%>"  <%if(!permissionEdit) {Response.Write("disabled");}%>   roleCategory ="<%#Eval("Category") %>" title="编辑当前角色"><span class="icon icon-group_edit">&nbsp;</span>[修改]</a>&nbsp;
                    <a style="cursor: pointer;" rel="delete"  rid="<%#Eval("Id") %>"  <%if(permissionDelete != true) {Response.Write("disabled");}%>   title="删除当前角色"  ><span class="icon icon-group_delete">&nbsp;</span>[删除]</a>&nbsp;
                    <a style="cursor: pointer;" rel="setuser"  rid="<%#Eval("Id") %>"  <%if(!permissionRoleUser) {Response.Write("disabled");}%>   title="设置当前角色所拥有的用户"><span class="icon icon-group_link">&nbsp;</span>[用户]</a>
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
    </asp:GridView>
</div>

<div id="w"></div><div id="d"></div>
<script type="text/javascript">
    $(document).ready(function () {
        // 浏览器的高度和div的高度  
        var height = $(window).height();
        var divHeight = $("#scolldiv").height();

        //获取div对象  
        var divh = $("#scolldiv").get(0);

        //div高度大于屏幕高度把屏幕高度赋给div，并出现滚动条  
        if (divHeight > height - 40) {
            divh.style.height = height - 40;
            divh.style.overflow = "auto";
        }

        $('#txtCategory').combobox({
            url: 'handler/DataItemAdminHandler.ashx?action=GetCategory&categorycode=RoleCategory',
            method: 'get',
            valueField: 'ItemValue',
            textField: 'ItemName',
            editable: false,
            panelHeight: 'auto'
        });
    });  
</script>
</asp:Content>
